﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace DrawingScreen.Objects
{
    public class CPointer : CDrawingObject
    {
        public int x = -100;
        public int y = -100;

        private int type = 0;

        private Bitmap bmp;

        public CPointer(int id)
        {
            switch (id)
            { 
                case 0:
                    bmp = Properties.Resources.p00_red_finger_large_l;
                    type = 1;
                    break;

                case 1:
                    bmp = Properties.Resources.p01_red_finger_large_r;
                    type = 0;
                    break;

                case 2:
                    bmp = Properties.Resources.p02_red_finger_small_l;
                    type = 1;
                    break;

                case 3:
                    bmp = Properties.Resources.p03_red_finger_small_r;
                    type = 0;
                    break;

                case 4:
                    bmp = Properties.Resources.p04_stick_l;
                    type = 1;
                    break;

                case 5:
                    bmp = Properties.Resources.p05_stick_r;
                    type = 0;
                    break;

                case 6:
                    bmp = Properties.Resources.p06_violet_finger_large_l;
                    type = 1;
                    break;

                case 7:
                    bmp = Properties.Resources.p07_violet_finger_large_r;
                    type = 0;
                    break;

                case 8:
                    bmp = Properties.Resources.p08_violet_finger_small_l;
                    type = 1;
                    break;

                case 9:
                    bmp = Properties.Resources.p09_violet_finger_small_r;
                    type = 0;
                    break;

                case 10:
                    bmp = Properties.Resources.p10_white_finger_large_l;
                    type = 1;
                    break;

                case 11:
                    bmp = Properties.Resources.p11_white_finger_large_r;
                    type = 0;
                    break;

                case 12:
                    bmp = Properties.Resources.p12_white_finger_small_l;
                    type = 1;
                    break;

                case 13:
                    bmp = Properties.Resources.p13_white_finger_small_r;
                    type = 0;
                    break;

                default:
                    bmp = Properties.Resources.white_pointer_finger;
                    type = 0;
                    break;
            }

        }
        

        public override void Draw(System.Drawing.Graphics g)
        {
            if (type == 0)
            {
                g.DrawImage(bmp, new System.Drawing.Rectangle(x, y, bmp.Width, bmp.Height));
            }
            else if (type == 1)
            {
                g.DrawImage(bmp, new System.Drawing.Rectangle(x - bmp.Width, y, bmp.Width, bmp.Height));
            }
        }

        public override System.Xml.XmlNode convertToXmlNode(System.Xml.XmlDocument doc)
        {
            throw new NotImplementedException();
        }
    }
}
